home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / DBASE_UT / TPDB335 / TPDB.DOC < prev    next >
Text File  |  1993-11-02  |  55KB  |  1,946 lines

  1. This  documentation   was  written  using   Borland's  MicroStar  word
  2. processor.
  3.  
  4. THIS  SOFTWARE IS  PROTECTED BY  A COPYRIGHT  DULY REGISTERED WITH THE
  5. U.S. COPYRIGHT OFFICE. PIRACY WILL NOT  GO UNPUNISHED (IN THIS LIFE OR
  6. THE NEXT.)
  7.  
  8.                      (****************************************)
  9.                      (*               TPDB 3.30              *)
  10.                      (*     Turbo Pascal Tools for dBASE     *)
  11.                      (*                                      *)
  12.                      (*           Turbo Pascal 6.0           *)
  13.                      (*  Object - Oriented Database Toolbox  *)
  14.                      (*    Utilizing dBASE Compatible Data   *)
  15.                      (*                Files                 *)
  16.                      (*                                      *)
  17.                      (*            Copyright 1992            *)
  18.                      (*               Brian Corll            *)
  19.                      (*          All Rights Reserved         *)
  20.                      (*      dBASE, dBASE III, and dBASE     *)
  21.                      (*      III Plus are registered         *)
  22.                      (*    trademarks of Ashton-Tate Corp.   *)
  23.                      (*                                      *)
  24.                      (*    Turbo Pascal is a registered      *)
  25.                      (*    trademark of Borland Int. Corp.   *)
  26.                      (*                                      *)
  27.                      (*     Version 3.30  December, 1992     *)
  28.                      (*                                      *)
  29.                      (****************************************)
  30.                      (*     Portions copyright 1984,1991 by  *)
  31.                      (*       Borland International Corp.    *)
  32.                      (****************************************)
  33.  
  34.  
  35.             TPDB is  a toolbox of  Turbo Pascal 6.0  units which allow
  36.             you  to access,  index,  search,  read and  write database
  37.             files that were created with  dBASE III or III Plus, using
  38.             75+   Turbo  Pascal   procedures  and   functions  written
  39.             specifically   for   these   purposes,   and  implementing
  40.             object-oriented techniques. This toolbox supports multiple
  41.             data  files  and  associated   indexes (NOT dBASE INDEXES !)
  42.             limited only by available  memory and file handles allowed
  43.             by DOS. Index keys can be up to 254 characters, and can be
  44.             composed of multiple fields  or expressions which evaluate
  45.             to a string not longer than 254 characters.
  46.  
  47.            ************************************************************
  48.            *             My CompuServe ID is 72440,650                *
  49.            ************************************************************
  50.  
  51.             This  program  is  being  distributed  under the Shareware
  52.             concept.
  53.  
  54.             If you like this program and use it, a registration fee of
  55.             $ 19.95 is required for non-profit users. Commercial users
  56.             MUST  register for  a one-time,  royalty-free registration
  57.             fee of $ 39.95. Registered  users will receive source code
  58.             for TPDB.tpu, TPDBDATE.tpu, TPDBScrn.tpu, TPDBStr.tpu, and
  59.             TPDBSort.tpu.  Registration also  includes free  technical
  60.             support, within the limitations  of my time and resources.
  61.             Site licenses are available. See the file REGISTER.FRM for
  62.             details.
  63.  
  64.             NOTA BENE:  This registration fee is  intended to cover my
  65.             personal  time  and  expense  in  developing, documenting,
  66.             distributing,  and supporting  this toolbox,  and does not
  67.             constitute the sale of the code contained therein.
  68.  
  69.  
  70.             Write to:
  71.  
  72.                          SoftIron
  73.                          Brian Corll
  74.                          1002 East Simpson Street
  75.                          Mechanicsburg,PA  17055
  76.  
  77.             Make checks payable to Brian Corll.
  78.  
  79.             DISCLAIMER
  80.  
  81.             This program  is provided "as is"  without warranty of any
  82.             kind, either express or  implied, included but not limited
  83.             to the implied warranty of merchantability and fitness for
  84.             a specific purpose. The entire  risk as to the quality and
  85.             performance of this program is with you.
  86.  
  87.             In  no event  will the  author be  liable to  you for  any
  88.             damages, including any lost profits, lost savings or other
  89.             incidental or consequential damages arising out of the use
  90.             of or inability to use this program.
  91.  
  92.             That said, please  be assured that I have  spent many long
  93.             hours trying to make this toolbox  the best it can be, and
  94.             I'm working to make it even better !
  95.  
  96. (**********************************)
  97. (* Interface Listing for TPDB.pas *)
  98. (**********************************)
  99.  
  100.  
  101. Unit TPDB;
  102.  
  103. {This version is Version 3.30 December, 1992}
  104.  
  105.  
  106.                      (***********************************)
  107.                      (*         Object -Oriented        *)
  108.                      (*     Turbo Pascal 6.0 Unit       *)
  109.                      (*    for Accessing dBASE III      *)
  110.                      (*             files.              *)
  111.                      (*        Copyright 1991           *)
  112.                      (*          Brian Corll            *)
  113.                      (*       All Rights Reserved       *)
  114.                      (*     dBASE is a registered       *)
  115.                      (* trademark of Ashton-Tate, Inc.  *)
  116.                      (*   Version 3.24 October,1991     *)
  117.                      (***********************************)
  118.                      (*   Portions Copyright 1984,1991  *)
  119.                      (*    Borland International Corp.  *)
  120.                      (***********************************)
  121.  
  122.  
  123. INTERFACE
  124.  
  125. Uses CRT,Dos,TPDBINDX,TPDBDate,TPDBScrn,TPDBStr;
  126.  
  127.  
  128. (******************************)
  129. (*      Global VARiables      *)
  130. (******************************)
  131.  
  132. CONST
  133.  
  134.   (**************************************************************************)
  135.    MaxInds = 10; {Maximum number of indexes per file.  Change this as needed.}
  136.   (**************************************************************************)
  137.  
  138.   AutoWrap    : Boolean = FALSE;
  139.   {Set this to TRUE to enable wrapping of field input.}
  140.  
  141.   { These are screen editing control keys:
  142.   CursorDown  = ^X;
  143.   CursorEND   = ^F;
  144.   CursorHome  = ^A;
  145.   CursorLeft  = ^S;
  146.   CursorRight = ^D;
  147.   CursorUp    = ^E;
  148.   DelKey      = ^G;
  149.   Escape      = ^[;
  150.   ExtKey       : Boolean = FALSE;
  151.   PageDown     = ^C;
  152.   PageUp       = ^R;
  153.   Return       = ^M;
  154.   TabKey       = #9;}
  155.  
  156.   { These constants determine whether or not index keys are unique:
  157.   NoDuplicates = 0;
  158.   Duplicates  =  1;}
  159.  
  160.   Filler  :  Char  =  #32;  {This  is  the character displayed for blank
  161.   portion of fields during editing and display.}
  162.  
  163.   {Numeric processing minimum and maximum values
  164.   MaxLong      = 2147483647;
  165.   MaxReal      = 3.4E37;
  166.   MinLong      = -2147483647;
  167.   MinReal      = 1.5E-45;}
  168.  
  169.  
  170.  
  171.   UpperCase  : Boolean  = FALSE;  {Turns upper  case conversion ON/OFF
  172.   during screen input.}
  173.  
  174.   {Date format constants}
  175.   {Used by SetDateFormat procedure}
  176.   French   = 1; {dd/mm/yy}
  177.   German   = 2; {dd.mm.yy}
  178.   Italian  = 3; {dd-mm-yy}
  179.   American = 4; {mm/dd/yy}
  180.   British  = 5; {dd/mm/yy}
  181.   Ansi     = 99;{yy.mm.dd}
  182.  
  183.  
  184.  
  185. Type
  186.   Str2     = String[2];
  187.   Str4     = String[4];
  188.   Str5     = String[5];
  189.   Str6     = String[6];
  190.   Str8     = String[8];
  191.   Str10    = String[10];
  192.   Str15    = String[15];
  193.   Str20    = String[20];
  194.   Str30    = String[30];
  195.   Str60    = String[60];
  196.   Str80    = String[80];
  197.   Str132   = String[132];
  198.   Str254   = String[254];
  199.   CharSet  = Set of Char;
  200.   ByteSet  = Set of Byte;
  201.  
  202.   FileName = String[66];
  203.   DBRecPtr = ^DBType;
  204.   DBType   = Array[1..4000] of Char;  (* dBASE record buffer *)
  205.  
  206.           DBHeader = RECORD  (* dBASE file header *)
  207.           DBType    : Byte;
  208.           Year      : Byte;
  209.           Month     : Byte;
  210.           Day       : Byte;
  211.           RecCount  : LongInt;
  212.           Location  : Integer;
  213.           RecordLen : Integer;
  214.           Reserved  : Array[1..20] of Byte;
  215.           Terminator : Char;
  216.           END;
  217.  
  218.           DBField = Record (* DBF field descriptors *)
  219.           FieldName    : Array[1..11] of Char;
  220.           FieldType    : Byte;
  221.           FieldAddress : LongInt;
  222.           FieldLen     : Byte;
  223.           FieldDec     : Byte;
  224.           Reserved     : Array[1..14] of Char;
  225.           END;
  226.  
  227.           HeadPtr = ^DBHeader;
  228.           PosPtr = ^DBEditArray;
  229.           FieldPtr = ^FieldArray;
  230.           DBEditArray = Array[1..2,1..128] of Integer;
  231.           FieldArray  = Array[1..128] of DBField;
  232.  
  233.           DBIndex = RECORD  (* Index file control  record *)
  234.           Ndx : IndexFile;
  235.           NdxID : BYTE;
  236.           NdxName : FileName;
  237.           Open : BOOLEAN;
  238.           END;
  239.  
  240.           NdxArray = ARRAY[1..MaxInds] OF DBIndex;
  241.           NdxPtr = ^NdxArray;
  242.  
  243. (*****************************************************************************)
  244. (*             Database File Object Declaration                              *)
  245. (*****************************************************************************)
  246.  
  247.    DataObject = ^DBF;
  248.  
  249.    DBF =  OBJECT     {The main, and only, object.}
  250.        DBFName     : FileName;
  251.        DBFile      : File;
  252.        Header      : HeadPtr;
  253.        Fields      : FieldPtr;
  254.        Positions   : ^DBEditArray;
  255.        DBFOpen     : BOOLEAN;
  256.        IndsOpen    : BOOLEAN;
  257.        Indexes     : NdxPtr;
  258.        DBRecord    : ^DBType;
  259.        DBRecNum    : LONGINT;
  260.        TotalRecs   : LONGINT;
  261.        NumFields   : BYTE;
  262.        MAlloc      : BOOLEAN;
  263.        Start,Stop  : INTEGER;
  264.        FUNCTION    Add(Field1,Field2 : Byte):string;
  265.        PROCEDURE   AddDBKey(NdxID : BYTE;KeyStr : DBKey);
  266.        PROCEDURE   AddDBRec;
  267.        FUNCTION    Allocated : BOOLEAN;
  268.        PROCEDURE   AppendBlank;
  269.        PROCEDURE   BailOut;
  270.        FUNCTION    BinSearch(FieldNo : BYTE;
  271.         Position : Integer;SearchKey : DBKey) : LONGINT;
  272.        FUNCTION    BOF : Boolean;
  273.        PROCEDURE   CloseDBIndex(NdxID : BYTE);
  274.        PROCEDURE   DBReset;
  275.        PROCEDURE   DelDBKey(KeyStr : DBKey;NdxID : BYTE);
  276.        FUNCTION    Deleted : Boolean;
  277.        PROCEDURE   Display;
  278.        FUNCTION    Divide(Field1,Field2 : Byte):string;
  279.        DESTRUCTOR  Done;
  280.        FUNCTION    DBEOF : BOOLEAN;
  281.        FUNCTION    Field(FNo : Byte) : string;
  282.        PROCEDURE   FillRecs(NumRecs : LongInt);
  283.        PROCEDURE   Find(NdxID : BYTE;SearchStr : string);
  284.        PROCEDURE   FlushDB;
  285.        PROCEDURE   Get(FNo,X,Y : Byte);
  286.        PROCEDURE   GetDBRec(RecordNumber : LongInt);
  287.        FUNCTION    GetField(RecordNo : LongInt;FNo : Byte) : String;
  288.        PROCEDURE   GoBottom;
  289.        PROCEDURE   GoTop;
  290.        FUNCTION    IIF(BoolVAR : Boolean;IfTRUE,IfFALSE : String) : String;
  291.        PROCEDURE   IndexOn(NdxID : BYTE;NdxName : FileName;
  292.                         NdxField : BYTE;DupFlag : BYTE);
  293.        CONSTRUCTOR Init(DBName : FileName);
  294.        FUNCTION    LastRec : LONGINT;
  295.        FUNCTION    Locate(FieldNo : BYTE;SearchStr : String) : BOOLEAN;
  296.        PROCEDURE   LookUp(SearchStr : string;NdxID : BYTE);
  297.        PROCEDURE   MakeDBIndex(NdxID : BYTE;DBIndexName : FileName;KeyLen,Status : Integer);
  298.        PROCEDURE   Mark;
  299.        FUNCTION    Mul(Field1,Field2 : Byte):string;
  300.        PROCEDURE   NextDBKey(NdxID : BYTE;KeyStr : DBKey);
  301.        PROCEDURE   NewDBRec;
  302.        PROCEDURE   NextRec;
  303.        PROCEDURE   OpenDBIndex(NdxID : BYTE;DBIndexName : FileName;KeyLen,Status : Integer);
  304.        PROCEDURE   Pack;
  305.        PROCEDURE   PrevDBKey(NdxID : BYTE;KeyStr : DBKey);
  306.        PROCEDURE   PrevRec;
  307.        PROCEDURE   PutDBRec(RecordNumber : LongInt);
  308.        PROCEDURE   ReadDBHeader;
  309.        PROCEDURE   Recall;
  310.        FUNCTION    RecCount : LONGINT;
  311.        FUNCTION    RecNo : LONGINT;
  312.        PROCEDURE   Repl(FNo : Byte;InStr : string);
  313.        PROCEDURE   ReplEach(FNo : Byte;InStr : String);
  314.        PROCEDURE   Save;
  315.        PROCEDURE   Say(FNo,Row,Col : Byte);
  316.        PROCEDURE   SetIndexTo(NdxID : Byte);
  317.        PROCEDURE   ShowStatus;
  318.        PROCEDURE   Skip(NumRecs : Longint);
  319.        FUNCTION    Sub(Field1,Field2 : Byte) : string;
  320.        FUNCTION    Sum(FNo : Byte) : Real;
  321.        PROCEDURE   WriteDBHeader;
  322.        PROCEDURE   Zap;
  323.        END;
  324.  
  325. (****************************************************************************)
  326. (*          END Object Declaration                                          *)
  327. (****************************************************************************)
  328.  
  329. Const
  330.  
  331.         Up   : CharSet = [CursorUp];
  332.         Down : CharSet = [CursorDown,Return];
  333.         Next : CharSet = [Escape];
  334.  
  335. VAR
  336.         FilesOpen : BYTE;
  337.         UCKey : BOOLEAN;
  338.         ErrCode : INTEGER;
  339.         Found : BOOLEAN;
  340.         Ch,BC : CHAR;
  341.         Normal,Reverse : BYTE;
  342.         Decimals : Byte;
  343.         TempFile : File;
  344.         K : Byte;
  345.         NumLen : Byte;
  346.         Y,M,D,DW : WORD;
  347.         FromPack : BOOLEAN;
  348.         DateFormat : BYTE;
  349.  
  350. (**********************************)
  351. (*   PROCEDUREs and FUNCTIONs     *)
  352. (**********************************)
  353.  
  354. PROCEDURE Beep;
  355. {Sound a couple of tones.}
  356.  
  357. FUNCTION BoolToStr(Param : Byte;IfTRUE,IfFALSE : Char): String;
  358.  
  359.  
  360. PROCEDURE CheckScreen(VAR CurrPos:Byte;BC:Char;Up,Down:CharSet;Low,High:Byte);
  361. {Used in full screen editing.}
  362.  
  363. PROCEDURE CopyFile(Source,Dest : FileName);
  364.  
  365. PROCEDURE FlashFill(Row,Col,Rows,Cols,Attr : Byte;Ch : Char);
  366. {Fill a region of the screen with a specified color and character.}
  367.  
  368. FUNCTION GetBoolean(VAR Param:Byte;IfTRUE,IfFALSE:Char;X,Y:Byte):Char;
  369.  
  370. FUNCTION GetByte(VAR Param:Byte;LowLim,UpLim,Len,X,Y:Byte):Char;
  371.  
  372. FUNCTION GetInteger(VAR Param:Integer;LowLim,UpLim:Integer;Len,X,Y:Byte):Char;
  373. {Input an integer.}
  374.  
  375. FUNCTION GetLongInt(VAR Param:LongInt;LowLim,UpLim:LongInt;Len,X,Y:Byte):Char;
  376. {Input a long integer.}
  377.  
  378. FUNCTION GetReal(VAR Param : Real; LowLim, UpLim : Real; Len, X, Y : Word) : Char;
  379. {Input a real number.}
  380.  
  381. FUNCTION GetString(VAR Param : String; Len, X, Y : Byte) : Char;
  382. {Input a string.}
  383.  
  384. FUNCTION Input(VAR S:String;Term:CharSet;L,X,Y:Byte;VAR BC:Char):String;
  385.  
  386. FUNCTION IntToStr(Number : LongInt): String;
  387.  
  388. FUNCTION Max(N1,N2 : Integer) : Integer;
  389.  
  390. FUNCTION Min(N1,N2 : Integer) : Integer;
  391.  
  392. PROCEDURE Prompt(Row,Col : Byte;PromptStr : Str80);
  393. {Display a prompt at a specified row and column.}
  394.  
  395. FUNCTION ReadChar : Char;
  396.  
  397. PROCEDURE ReadKB (VAR ExtKey: Boolean; VAR Ch: Char);
  398.  
  399. FUNCTION RealToStr(Number : Real): String;
  400.  
  401. PROCEDURE SetDateFormat(Format : BYTE);
  402.  
  403. PROCEDURE SetDBColor(FG,BG : Byte);
  404. {Set initial foreground and background colors.}
  405.  
  406. PROCEDURE Wait;
  407. {Wait for a key press and display a message.}
  408.  
  409.         (************************************************************)
  410.         (*  Documentation for Procedures and Functions in TPDB.tpu  *)
  411.         (************************************************************)
  412.  
  413.             Add function
  414.  
  415.             Function
  416.  
  417.                         Adds two numeric fields
  418.  
  419.             Syntax
  420.  
  421.                         Add(Field1,Field2 : Byte);
  422.  
  423.             Remarks
  424.  
  425.                         Field1 and Field2 are the order numbers of the
  426.                         respective fields  as they appear  in the .DBF
  427.                         structure.
  428.  
  429.             *************************
  430.  
  431.             AddDBKey procedure
  432.  
  433.             Function Adds a key string  to the index currently in
  434.             use.
  435.  
  436.             Syntax
  437.                          AddDBKey(NdxID : BYTE;KeyStr : DBKey);
  438.  
  439.             Remarks
  440.  
  441.                          KeyStr  is  any  string  not  longer than 254
  442.                          characters.  A field  must be  converted to a
  443.                          string  by  using   the  Field  function
  444.                          (q.v.).
  445.  
  446.                          NdxID is the index ID number.
  447.  
  448.             Restrictions
  449.  
  450.                          Length(KeyStr) must be in the range of 1..254
  451.                          characters. All expressions  must evaluate to
  452.                          a single string not  more than 254 characters
  453.                          in length.
  454.  
  455.  
  456.             *************************
  457.  
  458.             AddDBRec procedure
  459.  
  460.             Function
  461.  
  462.                         Adds a new record to the .DBF file in use.
  463.  
  464.             Syntax
  465.  
  466.                         AddDBRec;
  467.  
  468.             Remarks
  469.  
  470.                         A new record must first be created with a call
  471.                         to the NewDBRec procedure.
  472.  
  473.             ************************
  474.  
  475.             AppendBlank procedure
  476.  
  477.             Function
  478.  
  479.                        Appends  a  new  blank  record  to  the current
  480.                        database file.
  481.  
  482.             Syntax
  483.  
  484.                        AppendBlank;
  485.  
  486.             ***********************
  487.  
  488.             BinSearch function
  489.  
  490.             Function
  491.  
  492.                        Performs  a  binary  search  on  a  sorted
  493.                        database,  searching for  s specified  key
  494.                        string in a specified field, starting from
  495.                        a  specific  position  within  the  field.
  496.             Syntax
  497.  
  498.                        BinSearch(FieldNo : BYTE;Position : Integer;
  499.                         SearchKey : DBKey) : LONGINT;
  500.  
  501.             ***********************
  502.  
  503.             BlockCursor procedure
  504.  
  505.             Function
  506.  
  507.                         Turns on a block cursor.
  508.  
  509.             Syntax
  510.  
  511.                         BlockCursor;
  512.  
  513.             ************************
  514.  
  515.             BOF function
  516.  
  517.             Function
  518.  
  519.                         Returns  beginning of  file status  of a  .DBF
  520.                         file.
  521.  
  522.             Syntax
  523.  
  524.                         BOF
  525.  
  526.             Result Type
  527.  
  528.                         Boolean
  529.  
  530.  
  531.  
  532.             ************************
  533.  
  534.             CalcDate function
  535.  
  536.             Function
  537.  
  538.                         Add or subtract days,months, or years from two
  539.                         dates.
  540.  
  541.             Syntax
  542.  
  543.                         CalcDate(InDate:DateStr;Days,Months,Years:
  544.                         integer): DateStr;
  545.  
  546.             *************************
  547.  
  548.             CDOW function
  549.  
  550.             Function
  551.  
  552.                         Returns   character   day   of   week  -  i.e.
  553.                         'Monday','Tuesday',etc.
  554.  
  555.             Syntax
  556.  
  557.                         CDOW(InDate : DateStr): DayStr;
  558.  
  559.             *************************
  560.  
  561.             CMonth function
  562.  
  563.             Function
  564.  
  565.                         Returns character month - i.e. 'March'
  566.  
  567.             Syntax
  568.  
  569.                         CMonth(InDate : DateStr) : Str9;
  570.  
  571.             *************************
  572.  
  573.             ChAttr procedure
  574.  
  575.             Function
  576.  
  577.                         Changes   the  display   attribute  of  a
  578.                         specified  number  of   characters  on  a
  579.                         specified line.
  580.  
  581.             Syntax
  582.  
  583.                         ChAttr(Number : Word; Row, Col, Attr : Word);
  584.  
  585.             Remarks
  586.  
  587.                         This procedure is contained in ATTR.obj.
  588.  
  589.            **************************
  590.  
  591.            ChAllAttr procedure
  592.  
  593.            Function
  594.  
  595.                         Changes   the  display   attribute  of  a
  596.                         specified screen block.
  597.  
  598.  
  599.            Syntax
  600.  
  601.                         ChAllAttr(Row,Col,Rows,Cols,Attr : Word);
  602.  
  603.            **************************
  604.  
  605.             CheckScreen procedure
  606.  
  607.             Function
  608.  
  609.                         Checks the current  field being edited against
  610.                         minimum   and   maximum   limits   of   fields
  611.                         displayed.
  612.                                      K
  613.             Syntax
  614.  
  615.                         CheckScreen(VarCurrPos:Byte;BC:Char;Up,Down:CharSet;
  616.                         Low,High:Byte);
  617.  
  618.             Remarks
  619.  
  620.                         CurrPos is  the number of  the field currently
  621.                         being edited in the editing loop (see DEMO.pas
  622.                         for an example).
  623.  
  624.                         BC  is  the  terminating  character when field
  625.                         editing has been completed.
  626.  
  627.                         Up  and  Down  are  the  character  sets which
  628.                         contain the terminating characters which allow
  629.                         you to  move from one field  to another, up or
  630.                         down. In TPDB, they  are declred as constants,
  631.                         as follows:
  632.  
  633.                                 Up : CharSet = [CursorUp]; Down :
  634.                                 CharSet = [CursorDown,Return];
  635.  
  636.  
  637.                         Low and  High are the low  and high numbers of
  638.                         the displayed fields.
  639.  
  640.             ************************
  641.  
  642.             CloseDBFile procedure
  643.  
  644.             Function
  645.  
  646.                         Closes the currently open .DBF file.
  647.  
  648.             Syntax
  649.  
  650.                         CloseDBFile;
  651.  
  652.             Remarks
  653.  
  654.                         This procedure is error-checked.
  655.  
  656.             ************************
  657.  
  658.             CloseDBIndex procedure
  659.  
  660.             Function
  661.  
  662.                         Closes the index currently in use.
  663.  
  664.             Syntax
  665.  
  666.                         CloseDBIndex(NdxID : BYTE);
  667.  
  668.             Remarks
  669.  
  670.                         NdxID is a number  assigned to the index. This
  671.                         procedure is error-checked.
  672.  
  673.             ************************
  674.  
  675.             CompDates function
  676.  
  677.             Function
  678.  
  679.                         Compares two  dates and calculates  the number
  680.                         of days between them.
  681.  
  682.             Syntax
  683.  
  684.                         CompDates(Date1,Date2 : DateStr):Word;
  685.  
  686.             *************************
  687.  
  688.             CTOD function
  689.  
  690.             Function
  691.  
  692.                         Converts  a .DBF  compatible date  field to  a
  693.                         word date type for date arithmetic.
  694.  
  695.             Syntax
  696.  
  697.                         CTOD(InDate: DateStr) : DateType;
  698.  
  699.             *************************
  700.  
  701.             CursorOn and CursorOff procedures
  702.  
  703.             Function
  704.  
  705.                         Turn cursor on and off
  706.  
  707.             Syntax
  708.  
  709.                         CursorOn; CursorOff;
  710.  
  711.                         Externally declared in Flash.obj.
  712.  
  713.             *************************
  714.  
  715.  
  716.             DBReset procedure
  717.  
  718.             Function
  719.  
  720.                         Resets a .DBF file, moving the file pointer to
  721.                         record 1.
  722.  
  723.             Syntax
  724.  
  725.                         DBReset;
  726.  
  727.             Remarks
  728.  
  729.                         This procedure is error-checked.
  730.  
  731.             ************************
  732.  
  733.             DelDBKey procedure
  734.  
  735.             Function
  736.  
  737.                         Deletes a key string in the index currently in
  738.                         use.
  739.  
  740.             Syntax
  741.  
  742.                         DelDBKey(KeyStr : DBKey;NdxID : BYTE);
  743.  
  744.             Remarks
  745.  
  746.                          See documentation for AddDBKey procedure.
  747.  
  748.  
  749.  
  750.             *************************
  751.  
  752.  
  753.             Deleted function
  754.  
  755.             Function
  756.  
  757.                         Returns  True if  the curent  record has  been
  758.                         marked for deletion, False  if it has not been
  759.                         marked.
  760.  
  761.             Syntax
  762.  
  763.                         Deleted : boolean;
  764.  
  765.  
  766.             ************************
  767.  
  768.             Display procedure
  769.  
  770.             Function
  771.  
  772.                         Displays  the  current  record  in a partially
  773.                         formatted manner.
  774.  
  775.             Syntax
  776.  
  777.                         Display;
  778.  
  779.             Remarks
  780.  
  781.                         Date fields are formatted as MM/DD/YY.
  782.  
  783.             *************************
  784.  
  785.             Divide function
  786.  
  787.             Function
  788.  
  789.                         Divides field1 BY field2
  790.  
  791.             Syntax
  792.  
  793.                         Divide(Field1,Field2 : Byte):string;
  794.  
  795.             Remarks
  796.  
  797.                         Field1 and Field2 are the order numbers of the
  798.                         respective fields  as they appear  in the .DBF
  799.                         structure.
  800.  
  801.             *************************
  802.  
  803.             Done DESTRUCTOR
  804.  
  805.             This  destructor MUST  be called  when closing  a database
  806.             file. Calling this procedure closes all associated indexes
  807.             at the same time.
  808.  
  809.             Syntax
  810.             VAR
  811.                Example : DataObject;
  812.  
  813.                         DISPOSE(Example^,Done);
  814.  
  815.  
  816.             *************************
  817.  
  818.             DTOC function
  819.  
  820.             Function
  821.  
  822.                         Converts  a   word  date  type   to  a  string
  823.                         compatible with .DBF date fields.
  824.  
  825.             Syntax
  826.  
  827.                         DTOC(Julian: DateType) : DateStr;
  828.  
  829.             *************************
  830.  
  831.             EOF function
  832.  
  833.             Function
  834.  
  835.                         Returns end-of-file status of a .DBF file.
  836.  
  837.             Syntax
  838.  
  839.                         EOF
  840.  
  841.             Return Type
  842.  
  843.                         Boolean
  844.  
  845.             ************************
  846.  
  847.             Field function
  848.  
  849.             Function
  850.  
  851.                         Returns the string value  of a specified field
  852.                         in a specified record in a .DBF file.
  853.  
  854.             Syntax
  855.  
  856.                         Field(FNo : Byte) : string;
  857.  
  858.             Remarks
  859.  
  860.                         FNo  is the  number of  the field  in the .DBF
  861.                         file structure. Date fields are not formatted.
  862.  
  863.             ************************
  864.  
  865.             FillRecs procedure
  866.  
  867.             Function
  868.  
  869.                         Appends a specified number of blank records to
  870.                         a .DBF file.
  871.  
  872.             Syntax
  873.  
  874.                         FillRecs(NumRecs : LongInt);
  875.  
  876.             ************************
  877.  
  878.             Find procedure
  879.  
  880.             Function
  881.  
  882.                         Searches  for a  string in  the currently open
  883.                         index.
  884.  
  885.             Syntax
  886.  
  887.                         Find(NdxID : BYTE;SearchStr : string);
  888.  
  889.             Remarks
  890.                          NdxID  is  the  ID  number  assigned  to  the
  891.                          current  index.  If  the  string  is found, a
  892.                          value  of  True  is  returned  in  the global
  893.                          boolean variable Found. If  the string is not
  894.                          found, a value of False is returned in Found.
  895.  
  896.             ************************
  897.  
  898.             Flash procedure
  899.  
  900.             Function
  901.  
  902.                         Writes a string at a specified row and column,
  903.                         using a  specified attribute, by  direct video
  904.                         access.
  905.  
  906.             Syntax
  907.  
  908.                         Flash(Row,Col, Attr:byte; Str : String);
  909.  
  910.             Remarks
  911.  
  912.                         When  setting attribute,  constant folding can
  913.                         be  used.  See   color  constants  in  globals
  914.                         section.
  915.  
  916.             ************************
  917.  
  918.             FlashC procedure
  919.  
  920.             Function
  921.  
  922.                         Writes a  centered string at  a specified row,
  923.                         using a  specified attribute, by  direct video
  924.                         access.
  925.  
  926.             Syntax
  927.  
  928.                         FlashC(Row,Attr:Byte;Str : String);
  929.  
  930.             Remarks
  931.  
  932.                         See remarks for Flash procedure.
  933.  
  934.             ************************
  935.  
  936.             FlashFill procedure
  937.  
  938.             Function
  939.  
  940.                         Fills   a  specified   screen  block   with  a
  941.                         specified character and attribute.
  942.  
  943.             Syntax
  944.  
  945.                         FlashFill(Row,Col,Rows,Cols,Attr        :
  946.                         Byte;Ch : Char);
  947.  
  948.             Remarks
  949.  
  950.                         See remarks for other Flash procedures.
  951.  
  952.             ************************
  953.  
  954.  
  955.             FlushDB procedure
  956.  
  957.             Function
  958.  
  959.                         Flushes  records currently  in memory  to disk
  960.                         file.
  961.  
  962.             Syntax
  963.  
  964.                         FlushDB;
  965.  
  966.             Remarks
  967.  
  968.                         This procedure is error-checked.
  969.  
  970.  
  971.             ************************
  972.  
  973.             FormDate function
  974.  
  975.             Function
  976.  
  977.                         Formats a date string as stored in a .DBF file
  978.                         in the 'MM/DD/YY' format.
  979.  
  980.             Syntax
  981.  
  982.                         FormDate(InDate:DateStr):String;
  983.  
  984.             *************************
  985.  
  986.             Get procedure
  987.  
  988.             Function
  989.  
  990.                         Edits  a  specified  field  in  the  .DBF at a
  991.                         specified row and column.
  992.  
  993.             Syntax
  994.  
  995.                         Get(FieldNumber,Row,Col : Byte);
  996.  
  997.             Remarks
  998.  
  999.                         The following editing keys are active:
  1000.  
  1001.                         Left  cursor
  1002.                         Right  cursor
  1003.                         Home
  1004.                         End
  1005.                         Backspace
  1006.                         Delete
  1007.                         Ctrl-Y (Deletes the entire field.)
  1008.  
  1009.  
  1010.             ************************
  1011.  
  1012.             GetDBRec procedure
  1013.  
  1014.             Function
  1015.  
  1016.                         Locates and reads a specified record in a .DBF
  1017.                         file.
  1018.  
  1019.             Syntax
  1020.  
  1021.                         GetDBRec(RecordNumber : LongInt);
  1022.  
  1023.             ************************
  1024.  
  1025.  
  1026.             GetString procedure
  1027.  
  1028.             Function
  1029.  
  1030.                         Allows  screen  input  of  a  string,  as in a
  1031.                         search procedure.
  1032.  
  1033.             Syntax
  1034.  
  1035.                         GetString(Var Parameter : String; Length,
  1036.                         Row, Col : Byte) : Char;
  1037.  
  1038.             ************************
  1039.  
  1040.             GoBottom procedure
  1041.  
  1042.             Function
  1043.  
  1044.                         Set the file pointer at the end of file.
  1045.  
  1046.             Syntax
  1047.  
  1048.                         GoBottom;
  1049.  
  1050.             ************************
  1051.  
  1052.             GoTop procedure
  1053.  
  1054.             Function
  1055.  
  1056.                         Sets  the  file  pointer  at  the beginning of
  1057.                         file.
  1058.  
  1059.             Syntax
  1060.  
  1061.                         GoTop;
  1062.  
  1063.             ************************
  1064.  
  1065.  
  1066.             IIF function
  1067.  
  1068.             Function
  1069.  
  1070.                         Evaluates  a  boolean  variable  and returns a
  1071.                         string according to the value of the boolean.
  1072.  
  1073.             Syntax
  1074.  
  1075.                         IIF(BoolVar  :  Boolean;IfTrue,IfFalse  :
  1076.                         String) : String;
  1077.  
  1078.             ************************
  1079.  
  1080.             IndexOn procedure
  1081.  
  1082.             Function
  1083.  
  1084.                         Builds an index on a specified key field.
  1085.  
  1086.             Syntax
  1087.  
  1088.                         IndexOn(NdxID : BYTE;NdxName : FileName;
  1089.                           NdxField : BYTE;DupFlag : BYTE);
  1090.  
  1091.             Remarks
  1092.                         NdxID is an ID  number assigned to the current
  1093.                         index.  DupFlag  may  be  a  constant  such as
  1094.                         Duplicates or NoDuplicates.
  1095.  
  1096.             ************************
  1097.  
  1098.             Init CONSTRUCTOR
  1099.  
  1100.             Function
  1101.  
  1102.                         Initializes  a  data   object  and  opens  the
  1103.                         associated DBF file.
  1104.  
  1105.             Syntax
  1106.  
  1107.                         Init(DBName : FileName);
  1108.             VAR
  1109.                   Example : DataObject;
  1110.  
  1111.                         NEW(Example,Init('example.dbf'));
  1112.  
  1113.             ************************
  1114.  
  1115.             JustL function
  1116.  
  1117.             Function
  1118.  
  1119.                         Left   justifies   a   string   within  a
  1120.                         specified field length.
  1121.  
  1122.             Syntax
  1123.  
  1124.                         JustL(InString:     String;     FieldLen:
  1125.                         Integer): String;
  1126.  
  1127.             ************************
  1128.  
  1129.             LTrim function
  1130.  
  1131.             Function
  1132.  
  1133.                         Trims leading spaces from a string.
  1134.  
  1135.             Syntax
  1136.  
  1137.                         LTrim(InStr: String): String;
  1138.  
  1139.             *************************
  1140.  
  1141.             Locate procedure
  1142.  
  1143.             Function
  1144.  
  1145.                         Searches sequentially through a DBF file for a
  1146.                         specified search string, stopping at the first
  1147.                         record  which  matches  the  search condition.
  1148.  
  1149.             Syntax
  1150.                         Locate(FieldNo  : BYTE;SearchStr  : String)  :
  1151.                         BOOLEAN;
  1152.  
  1153.             ************************
  1154.  
  1155.             LookUp procedure
  1156.  
  1157.             Function
  1158.  
  1159.                        Searches for a key string in an index, and sets
  1160.                        the record pointer at the record containing the
  1161.                        closest match.
  1162.  
  1163.            Syntax
  1164.  
  1165.                        LookUp(SearchStr : string;NdxID: BYTE);
  1166.  
  1167.            ************************
  1168.  
  1169.             Lower function
  1170.  
  1171.             Function
  1172.  
  1173.                         Converts a string to lower case.
  1174.  
  1175.             Syntax
  1176.  
  1177.                         Lower(InStr: String):  String; Externally
  1178.                         declared in Flash.obj.
  1179.  
  1180.             *************************
  1181.  
  1182.             MakeDBIndex procedure
  1183.  
  1184.             Function
  1185.  
  1186.                         Creates  a new  index file  but does  not
  1187.                         build it.
  1188.  
  1189.             Syntax
  1190.                         MakeDBIndex(NdxID    :    BYTE;DBIndexName   :
  1191.                               FileName;KeyLen,Status : Integer);
  1192.  
  1193.             Remarks
  1194.  
  1195.                         DBIndexName can be a  maximum of 66 chars
  1196.                         in length  and is the full  path and name
  1197.                         of the index file  to be created. the key
  1198.                         field.
  1199.  
  1200.                         KeyLen  is the  length of  the key field.
  1201.                         Number  are  stored  as  strings  in .DBF
  1202.                         files,  and  can  thus  be  used  as keys
  1203.                         without conversion.
  1204.  
  1205.                         Status   is   defined   as   one  of  two
  1206.                         constants:  NoDuplicates,  or Duplicates,
  1207.                         according  to  whether  or  not duplicate
  1208.                         keys will be allowed in the index.
  1209.  
  1210.  
  1211.             ************************
  1212.  
  1213.             Mark procedure
  1214.  
  1215.             Function
  1216.  
  1217.                         Marks the current record for deletion.
  1218.  
  1219.             Syntax
  1220.  
  1221.                         Mark;
  1222.  
  1223.  
  1224.             ************************
  1225.  
  1226.             Max function
  1227.  
  1228.             Function
  1229.  
  1230.                         Determines the maximum of two integers
  1231.  
  1232.             Syntax
  1233.  
  1234.                         Max(N1,N2 : Integer) : Integer;
  1235.  
  1236.             *************************
  1237.  
  1238.             Min function
  1239.  
  1240.             Function
  1241.  
  1242.                         Determines the minimum of two integers
  1243.  
  1244.             Syntax
  1245.  
  1246.                         Min(N1,N2 : Integer) : Integer;
  1247.  
  1248.             *************************
  1249.  
  1250.             Mon function
  1251.  
  1252.             Function
  1253.  
  1254.                         Returns numeric value for  the month in a
  1255.                         date.
  1256.  
  1257.             Syntax
  1258.  
  1259.                         Mon(InDate : DateStr) : Byte;
  1260.  
  1261.             *************************
  1262.  
  1263.             Mul function
  1264.  
  1265.             Function
  1266.  
  1267.                         Multiplies two numeric fields.
  1268.  
  1269.             Syntax
  1270.  
  1271.                         Mul(Field1,Field2 : Byte):string;
  1272.  
  1273.             Remarks
  1274.  
  1275.                         Field1 and  Field2 are the  order numbers
  1276.                         of the  respective fields as  they appear
  1277.                         in the .DBF structure.
  1278.  
  1279.             *************************
  1280.  
  1281.             NewDBRec procedure
  1282.  
  1283.             Function
  1284.  
  1285.                         Creates  a  new  blank  record in memory,
  1286.                         ready for editing.
  1287.  
  1288.             Syntax
  1289.  
  1290.                         NewDBRec;
  1291.  
  1292.             ************************
  1293.  
  1294.             NextDBKey procedure
  1295.  
  1296.             Function
  1297.  
  1298.                         Moves file  record pointer to  the record
  1299.                         number associated with the next key in an
  1300.                         index.
  1301.  
  1302.             Syntax
  1303.  
  1304.                         NextDBKey(NdxID : BYTE;KeyStr : DBKey);
  1305.  
  1306.             Remarks
  1307.  
  1308.                          See    documentation     for    AddDBKey
  1309.                          procedure.
  1310.  
  1311.  
  1312.             ************************
  1313.  
  1314.             NextRec procedure
  1315.  
  1316.             Function
  1317.  
  1318.                         Moves  the  file   pointer  to  the  next
  1319.                         sequential record in the file.
  1320.  
  1321.             Syntax
  1322.  
  1323.                         NextRec;
  1324.  
  1325.             ************************
  1326.  
  1327.             OpenDBIndex procedure
  1328.  
  1329.             Function
  1330.  
  1331.                         Opens an index for search and updating.
  1332.  
  1333.             Syntax
  1334.  
  1335.                         OpenDBIndex(NdxID    :    BYTE;DBIndexName   :
  1336.                         FileName;KeyLen,Status : Integer);
  1337.  
  1338.             Remarks
  1339.  
  1340.                         DBIndexName can be a  maximum of 66 chars
  1341.                         in length  and is the full  path and name
  1342.                         of the index file  to be created. the key
  1343.                         field.
  1344.  
  1345.                         KeyLen  is the  length of  the key field.
  1346.                         Number  are  stored  as  strings  in .DBF
  1347.                         files,  and  can  thus  be  used  as keys
  1348.                         without conversion.
  1349.  
  1350.                         Status   is   defined   as   one  of  two
  1351.                         constants:  NoDuplicates,  or Duplicates,
  1352.                         according  to  whether  or  not duplicate
  1353.                         keys will be allowed in the index.
  1354.  
  1355.  
  1356.             ************************
  1357.  
  1358.             Pack procedure
  1359.  
  1360.             Function
  1361.  
  1362.                         Packs  a  .DBF  files,  removing  records
  1363.                         marked   for  deletion.   Pack  does   an
  1364.                         in-place  pack,  without  using temporary
  1365.                         files.
  1366.  
  1367.             Syntax
  1368.  
  1369.                         Pack;
  1370.  
  1371.             ************************
  1372.  
  1373.             PadL function
  1374.  
  1375.             Function
  1376.  
  1377.                         Pads a string with spaces on the left, to
  1378.                         a specified field length.
  1379.  
  1380.             Syntax
  1381.  
  1382.                         PadL(InStr:      String;     FieldLength:
  1383.                         Integer): String;
  1384.  
  1385.             ************************
  1386.  
  1387.             PadR function
  1388.  
  1389.             Function
  1390.  
  1391.                         Pads a  string with spaces  on the right,
  1392.                         to a specified field length.
  1393.  
  1394.             Syntax
  1395.  
  1396.                         PadR(InStr:      String;     FieldLength:
  1397.                         Integer): String;
  1398.  
  1399.  
  1400.             ************************
  1401.  
  1402.             PrevDBKey procedure
  1403.  
  1404.             Function
  1405.  
  1406.                         Moves file  pointer to the  record number
  1407.                         corresponding to  the previous key  in an
  1408.                         index.
  1409.  
  1410.             Syntax
  1411.  
  1412.                         PrevDBKey(NdxID : BYTE;KeyStr : DBKey);
  1413.  
  1414.             Remarks
  1415.  
  1416.                         See documentation for AddDBKey procedure.
  1417.  
  1418.  
  1419.             ************************
  1420.  
  1421.             PrevRec procedure
  1422.  
  1423.             Function
  1424.  
  1425.                         Moves  the file  pointer to  the previous
  1426.                         sequemtial record in the file.
  1427.  
  1428.             Syntax
  1429.  
  1430.                         PrevRec;
  1431.  
  1432.             ************************
  1433.  
  1434.             Prompt procedure
  1435.  
  1436.             Function
  1437.  
  1438.                         Displays a  prompt string at  a specified
  1439.                         row an column, using direct video writes.
  1440.  
  1441.             Syntax
  1442.  
  1443.                         Prompt(Row,Col : Byte;PromptStr : Str80);
  1444.  
  1445.             ************************
  1446.  
  1447.             PutDBRec procedure
  1448.  
  1449.             Function
  1450.  
  1451.                         Writes  the current  editing record  to a
  1452.                         specified record number in the .DBF file.
  1453.  
  1454.             Syntax
  1455.  
  1456.                         PutDBRec(RecordNumber : LongInt);
  1457.  
  1458.             Remarks
  1459.  
  1460.                         Be sure that  the specified record number
  1461.                         is the same as the  one given in the call
  1462.                         to GetDBRec.
  1463.  
  1464.             ************************
  1465.  
  1466.  
  1467.             ReadDBHeader procedure
  1468.  
  1469.             Function
  1470.  
  1471.                         Reads the file header of a .DBF file into
  1472.                         a buffer.
  1473.  
  1474.             Syntax
  1475.  
  1476.                         ReadDBHeader;
  1477.  
  1478.             ************************
  1479.  
  1480.             Recall procedure
  1481.  
  1482.             Function
  1483.  
  1484.                         Unmarks  a record  previously marked  for
  1485.                         deletion.
  1486.  
  1487.             Syntax
  1488.  
  1489.                         Recall;
  1490.  
  1491.             ************************
  1492.  
  1493.             Repl procedure
  1494.  
  1495.             Function
  1496.  
  1497.                         Replaces  a specified  field in  a record
  1498.                         with a specified string.
  1499.  
  1500.             Syntax
  1501.  
  1502.                         Repl(FieldNumber    :    Byte;ReplStr   :
  1503.                         string);
  1504.  
  1505.             Remarks
  1506.  
  1507.                         FieldNumber is the number of the field in
  1508.                         the .DBF  file structure. ReplStr  is the
  1509.                         string  with  which  the  field  is to be
  1510.                         replaced.  When  replacing  date  fields,
  1511.                         remember that the date  string must be in
  1512.                         the form "19910214".
  1513.  
  1514.             ************************
  1515.  
  1516.             ReplEach procedure
  1517.  
  1518.             Function
  1519.  
  1520.                         Replaces a specified field in each record
  1521.                         in a .DBF file with a specified string.
  1522.  
  1523.             Syntax
  1524.  
  1525.                         ReplEach(FieldNumber  :   Byte;ReplStr  :
  1526.                         String);
  1527.  
  1528.             Remarks
  1529.  
  1530.                         FieldNumber is the number of the field in
  1531.                         the .DBF  file structure. ReplStr  is the
  1532.                         string  with  which  the  field  is to be
  1533.                         replaced.  When  replacing  date  fields,
  1534.                         remember that the date  string must be in
  1535.                         the form "19910214".
  1536.  
  1537.             ************************
  1538.  
  1539.             Replicate function
  1540.  
  1541.             Function
  1542.  
  1543.                         Fills a string with a specified number of
  1544.                         a specified character.
  1545.  
  1546.             Syntax
  1547.  
  1548.                         Replicate(Ch  :  Char;Count   :  word)  :
  1549.                         String; Externally declared in Flash.obj.
  1550.  
  1551.             ************************
  1552.  
  1553.             RTrim function
  1554.  
  1555.             Function
  1556.  
  1557.                         Trims trailing blanks from a string.
  1558.  
  1559.             Syntax
  1560.  
  1561.                         RTrim(InStr: String): String;
  1562.  
  1563.             ************************
  1564.  
  1565.             Save procedure
  1566.  
  1567.             Function
  1568.  
  1569.                         Writes the current record to disk.
  1570.  
  1571.  
  1572.             Syntax
  1573.  
  1574.                         Save;
  1575.  
  1576.             ***********************
  1577.  
  1578.             Say procedure
  1579.  
  1580.             Function
  1581.  
  1582.                         Displays   a   particular   field   at  a
  1583.                         specified row and column.
  1584.  
  1585.             Syntax
  1586.  
  1587.                         Say(FieldNumber,Row,Col : Byte);
  1588.  
  1589.             Remarks
  1590.  
  1591.                         FieldNumber is the  position of the field
  1592.                         in the .DBF file structure.
  1593.  
  1594.             ************************
  1595.  
  1596.             SetDBColor
  1597.  
  1598.             Function
  1599.  
  1600.                         Sets  foreground   and  background  color
  1601.                         before a call to ClrScr.
  1602.  
  1603.             Syntax
  1604.  
  1605.                         SetDBColor(FG,BG : Byte);
  1606.  
  1607.             ************************
  1608.  
  1609.             SetDateFormat procedure
  1610.  
  1611.             Function
  1612.  
  1613.                         Sets date format to  one of the following
  1614.                         constants:
  1615.  
  1616.                         French   = 1; {dd/mm/yy}
  1617.                         German   = 2; {dd.mm.yy}
  1618.                         Italian  = 3; {dd-mm-yy}
  1619.                         American = 4; {mm/dd/yy}
  1620.                         British  = 5; {dd/mm/yy}
  1621.                         Ansi     = 99;{yy.mm.dd}
  1622.  
  1623.             Syntax
  1624.                         SetDateFormat(Format : Byte);
  1625.  
  1626.             Example
  1627.  
  1628.                         SetDateFormat(Ansi);
  1629.  
  1630.             ************************
  1631.  
  1632.             SetIndexTo procedure
  1633.  
  1634.             Function
  1635.                         Selects a specified index in the array of
  1636.                         currently open indexes.
  1637.  
  1638.             Syntax
  1639.  
  1640.                         SetIndexTo(NdxID : Byte);
  1641.  
  1642.             Example
  1643.                         See the sample program INDXDEMO.PAS.
  1644.  
  1645.             ************************
  1646.  
  1647.             ShowStatus procedure
  1648.  
  1649.             Function
  1650.  
  1651.                         Displays  status  of  .DBF  file, after a
  1652.                         call to ReadDBHeader.
  1653.  
  1654.             Syntax
  1655.  
  1656.                         ShowStatus;
  1657.  
  1658.             ************************
  1659.  
  1660.             Skip procedure
  1661.  
  1662.             Function
  1663.  
  1664.                         Skips a specified number  of records in a
  1665.                         DBF, either in indexed or natural order.
  1666.  
  1667.             Syntax
  1668.  
  1669.                         Skip(NumRecs : Longint);
  1670.  
  1671.             Example
  1672.                         See the sample program INDXDEMO.PAS.
  1673.  
  1674.             ************************
  1675.  
  1676.             SortOn procedure
  1677.  
  1678.             Function
  1679.  
  1680.                       Sorts a  DBF file to another  DBF, on a key
  1681.                       string expression  of up to  254 characters
  1682.                       in length.
  1683.  
  1684.                       See   SortDemo.pas  and   TPDBSort.pas  for
  1685.                       syntax and explanation.
  1686.  
  1687.             ***********************
  1688.  
  1689.             Sub function
  1690.  
  1691.             Function
  1692.  
  1693.                         Subtracts two numeric  fields - field2 is
  1694.                         subtracted FROM field1.
  1695.  
  1696.             Syntax
  1697.  
  1698.                         Sub(Field1,Field2 : Byte) : string;
  1699.  
  1700.             Remarks
  1701.  
  1702.                         Field1 and  Field2 are the  order numbers
  1703.                         of the  respective fields as  they appear
  1704.                         in the .DBF structure.
  1705.  
  1706.             *************************
  1707.  
  1708.             Sum function
  1709.  
  1710.             Function
  1711.  
  1712.                         Sums a numeric field  in all records in a
  1713.                         .DBF file.
  1714.  
  1715.             Syntax
  1716.  
  1717.                         Sum(FNo : Byte) : Real;
  1718.  
  1719.  
  1720.  
  1721.             ************************
  1722.  
  1723.             TimeNow function
  1724.  
  1725.             Function
  1726.  
  1727.                         Returns current time in formatted string.
  1728.  
  1729.             Syntax
  1730.  
  1731.                         TimeNow : TimeStr;
  1732.  
  1733.             *************************
  1734.  
  1735.             Today function
  1736.  
  1737.             Function
  1738.  
  1739.                         Returns current  date in .DBF  date field
  1740.                         compatible format.
  1741.  
  1742.             Syntax
  1743.  
  1744.                         Today : DateStr;
  1745.  
  1746.             *************************
  1747.  
  1748.             Upper function
  1749.  
  1750.             Function
  1751.  
  1752.                         Converts a string to upper case.
  1753.  
  1754.             Syntax
  1755.  
  1756.                         Upper(InStr:  String):  String; Externall
  1757.                         declared in Flash.obj.
  1758.  
  1759.             ************************
  1760.  
  1761.             ValidDate function
  1762.  
  1763.                         Checks  whether  a  date  is  valid,  and
  1764.                         returns True or False.
  1765.  
  1766.             Syntax
  1767.  
  1768.                         ValidDate(InDate : DateStr): boolean;
  1769.  
  1770.             *************************
  1771.  
  1772.             Wait procedure
  1773.  
  1774.             Function
  1775.  
  1776.                         Displays  a  prompt,  'Press  any  key to
  1777.                         continue...', and waits for a key press.
  1778.  
  1779.             Syntax
  1780.  
  1781.                         Wait;
  1782.  
  1783.             ************************
  1784.  
  1785.             WriteDBHeader procedure
  1786.  
  1787.             Function
  1788.  
  1789.                         Updates a .DBF file header.
  1790.  
  1791.             Syntax
  1792.  
  1793.                         WriteDBHeader;
  1794.  
  1795.  
  1796.             ************************
  1797.  
  1798.             Zap procedure
  1799.  
  1800.             Function
  1801.  
  1802.                         Deletes all records in a .DBF file.
  1803.  
  1804.             Syntax
  1805.  
  1806.                         Zap;
  1807.  
  1808.             Remarks
  1809.  
  1810.                         CAREFUL  !  This  procedure  really  does
  1811.                         remove all  records, completely rewriting
  1812.                         the file.
  1813.  
  1814.             ************************
  1815.  
  1816.             (**** Revision History ****)
  1817.  
  1818.             2/7/89 - Version 1.0 released
  1819.  
  1820.             2/8/89  - Version  1.1 -  fixed bug  in numeric input
  1821.             that caused truncation  of integers. Also, recompiled
  1822.             in  $N-,$E+  state  to  allow  for  8087 emulation on
  1823.             non-8087  machines.   Fixed  range  error   in  array
  1824.             indexing.
  1825.  
  1826.             Renamed unit TPDB10.tpu  to TPDB.tpu. Future versions
  1827.             will retain this name.
  1828.  
  1829.             2/10/89 - Version 1.2 - Modified indexing routines to
  1830.             allow for index keys up to 254 characters.
  1831.  
  1832.                 Added  boolean  variable,   UCKey,  which  allows
  1833.                 indexes to be created on upper case form of keys.
  1834.  
  1835.                 Added procedures Prompt and Upper.
  1836.  
  1837.                 Added procedures Flash, FlashC, and FlashFill.
  1838.  
  1839.                 Added CheckScreen procedure.
  1840.  
  1841.                 Expanded documentation and added demo files.
  1842.  
  1843.                 Temporarily  removed  source  code  from this doc
  1844.                 file  pending further  additions and  decision on
  1845.                 which source to include.
  1846.  
  1847.             2/14/89 - Version 1.3 - Added TPDB error handler.
  1848.  
  1849.                 Improved documentation.
  1850.  
  1851.                 Fixed bug in Display procedure.
  1852.  
  1853.                 Added Sum  and Field functions,  NextRec and
  1854.                 PrevRec procedures.
  1855.  
  1856.                 Added BOF and EOF functions.
  1857.  
  1858.                 Added PrevDBKey and NextDBKey procedures.
  1859.  
  1860.                 Added Repl and ReplEach procedures.
  1861.  
  1862.                 Added FillRecs procedure.
  1863.  
  1864.  
  1865.             2/22/89 - Version 2.0 - Modified indexing routines to
  1866.             allow key  expressions which evaluate to  a string to
  1867.             be passed to the indexing routines.
  1868.  
  1869.             Improved documentation.
  1870.  
  1871.             Added  new   assembler  string  and   video  handling
  1872.             procedures.
  1873.  
  1874.             Added source for TPDB.tpu.
  1875.  
  1876.             Added  TPDBDate.tpu  -  date  handling routines, with
  1877.             source.
  1878.  
  1879.             Added  TPDBMath.tpu  -  mathematical  functions, with
  1880.             source.
  1881.  
  1882.             Because of significant revisions and additions to the
  1883.             original  source,  released  this  version as version
  1884.             2.0.
  1885.  
  1886.             2/23/89 -  Version 2.1 - fixed  bug in array indexing
  1887.             in Display and Field procedures.
  1888.  
  1889.             3/1/89 -  Version 2.2 - modified  Repl and Field
  1890.             procedures to use Move procedure. Added TPDBHigh.pas,
  1891.             a unit  of high level  calls. Documentation for  high
  1892.             level  calls  is  contained  within  the source code.
  1893.  
  1894.             8/3/89  -  Version  3.0  -  Converted  to  object-oriented
  1895.             version. The number of DBF files  and NDX files per DBF is
  1896.             limited now only by the amount of available memory and the
  1897.             DOS  version in  use.  Procedures  and functions  added as
  1898.             documented above.
  1899.  
  1900.             8/19/89 - Version 3.1 -
  1901.  
  1902.             - Procedure SetColor changed to SetDBColor to prevent conflicts
  1903.               when the Graph unit is used.
  1904.  
  1905.             - Procedure  SetDateFormat was added to  allow use of
  1906.               foreign date formats.
  1907.  
  1908.               Supported date formats are as follows:
  1909.               CONST
  1910.               French   = 1; {dd/mm/yy}
  1911.               German   = 2; {dd.mm.yy}
  1912.               Italian  = 3; {dd-mm-yy}
  1913.               American = 4; {mm/dd/yy}
  1914.               British  = 5; {dd/mm/yy}
  1915.               Ansi     = 99;{yy.mm.dd}
  1916.  
  1917.            -  Added  procedures  ChAttr  and  ChAllAttr to change
  1918.               displayed screen  attributes.
  1919.  
  1920.            -  Added TPDBSort.tpu, containing Procedure SortOn.
  1921.  
  1922.            -  Added BinSearch routine, for searching sorted files of
  1923.               unique keys.
  1924.  
  1925.            - Version  3.11 - September,  1989 - moved  all string
  1926.              handling  functions into  TPDBStr.pas. Moved  most screen
  1927.              handling functions into TPDBScrn.pas.
  1928.  
  1929.            - Versions 3.12 - 3.16 - Minor maintenance releases
  1930.  
  1931.            - Version 3.20 - October, 1991 - changes to indexing scheme and
  1932.              Skip procedure and addition of SetIndexTo procedure.
  1933.  
  1934.            - Versions 3.21 - 3.24 - Minor bug fixes and addition of TPWin units
  1935.            - Version 3.24 released September,1992 - minor bug fix
  1936.            - Version 3.30 - includes precompiled index units for BP7.0
  1937.             ********************************************************
  1938.                     End  of Documentation  - TPDB  Version 3.30
  1939.                               Copyright 1991 Brian Corll
  1940.             ********************************************************
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.